<template>
  <div>
    <HETTable1
      ref="printerTable"
      :tableData="data.tableData"
      :tHead="data.tHead"
      :headerOperation="data.headerOperation"
      :checkBox="true"
      :size="data.pagination.size"
      :total="data.pagination.total"
      @chooseData="chooseData"
      @getTableData="getPrinterList"
    >
      <template #index>
        <el-table-column slot="index" type="index">
          <template #default="scope">
            {{ data.initTableParams.page * data.initTableParams.size + scope.$index + 1 }}
          </template>
        </el-table-column>
      </template>
      <template #operation>
        <el-table-column slot="operation" label="操作">
          <template #default="scope">
            <el-button @click="del(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </template>
    </HETTable1>
  </div>
</template>

<script setup>
import { ref, reactive, onMounted, computed } from "vue";
import { Search, Refresh, Delete, Plus } from "@element-plus/icons-vue";
onMounted(() => {
  getPrinterList();
});
const addPrinter = () => {};
const delPrinter = () => {};
const data = reactive({
  tHead: [
    {
      label: "序号",
      isCustom: true,
      type: "index",
      slotName: "index",
    },
    {
      label: "名称",
      prop: "name",
      isCustom: false,
      width: 200,
    },
    {
      label: "描述",
      prop: "desc",
      isCustom: false,
      width: 400,
    },
    {
      label: "操作",
      isCustom: true,
      slotName: "operation",
    },
  ],
  tableData: [
    {
      name: "打印机",
      desc: "hdfaosdf",
    },
  ],
  headerOperation: [
    {
      name: "添加",
      icon: Plus,
      handleClick: addPrinter,
    },
    {
      name: "删除",
      icon: Delete,
      handleClick: delPrinter,
    },
  ],
  initTableParams: {
    page: 0,
    size: 10,
  },
  pagination: {
    size: 10,
    total: 1,
  },
});
const getPrinterList = () => {};
</script>

<style lang="scss" scoped>
.operation {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}
</style>
